package com.mz.ozy.mvp.model;

import android.content.Context;

import com.mz.ozy.constants.Constants;
import com.mz.ozy.net.RetrofitUtils;
import com.mz.ozy.utils.JsonUtils;

import java.util.HashMap;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.ResponseBody;

/**
 * Created by administrator on 2018/12/3.
 */
public class ExpertModel {

    public Observable<ResponseBody> queryExpertList(Context context) {
        Map<String, String> jsonObject = new HashMap<>();
        jsonObject.put("t", Constants.tokenId);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10005, jsonObject);
    }

    public Observable<ResponseBody> queryExpertDetail(Context context, String uid, int pageNo, int dynamic) {
        Map<String, String> jsonObject = new HashMap<>();
        jsonObject.put("id", uid + "");
        jsonObject.put("pageNo", pageNo + "");
        jsonObject.put("pageSize", Constants.PageSize);
//        jsonObject.put("dynamic", dynamic + "");
//        jsonObject.put("t", Constants.tokenId);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10153, JsonUtils.requestJsonDate(jsonObject), Constants.tokenId);
    }

    public Observable<ResponseBody> queryHomePage(Context context, String uid, int pageNo, int dynamic) {
        Map<String, String> jsonObject = new HashMap<>();
        jsonObject.put("did", uid);
        jsonObject.put("pageNo", pageNo + "");
        jsonObject.put("pageSize", Constants.PageSize);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10154, JsonUtils.requestJsonDate(jsonObject), Constants.tokenId);
    }

    public Observable<ResponseBody> deFriend(Context context, String did) {
        Map<String, String> jsonObject = new HashMap<>();
        jsonObject.put("did", did);
        return RetrofitUtils.getApiService(context).post(Constants.TransCode.TransCode10155, JsonUtils.requestJsonDate(jsonObject), Constants.tokenId);
    }
}


